package models

import (
	"time"
)

// MaAIServiceFaceCount [...]
type MaAIServiceFaceCount struct {
	ID          string    `gorm:"primaryKey;column:id;type:bigint;not null;comment:设备权限ID" json:"id"`
	MerchantID  int64     `gorm:"column:merchant_id;type:bigint;not null;comment:商户id" json:"merchant_id"`
	RobotName   string    `gorm:"index:idx_startTime_robotName,priority:2,sort:desc;index:idx_createdDate_robotName,priority:2,sort:desc;column:robot_name;type:varchar(50);not null;comment:机器人名称" json:"robot_name"`
	StartTime   time.Time `gorm:"index:idx_startTime_robotName,priority:1,sort:desc;column:start_time;type:datetime;not null;comment:统计起始时间" json:"start_time"`
	FaceCount0  int64     `gorm:"column:face_count0;type:int;not null;default:0;comment:前曝光量" json:"face_count0"`
	FaceCount1  int64     `gorm:"column:face_count1;type:int;not null;default:0;comment:左曝光量" json:"face_count1"`
	FaceCount2  int64     `gorm:"column:face_count2;type:int;not null;default:0;comment:右曝光量" json:"face_count2"`
	FaceCount3  int64     `gorm:"column:face_count3;type:int;not null;default:0;comment:后曝光量" json:"face_count3"`
	Areas3      int64     `gorm:"column:areas3;type:bigint;default:null;comment:商场ID" json:"areas3"`
	EndTime     time.Time `gorm:"column:end_time;type:datetime;not null;comment:统计结束时间" json:"end_time"`
	CreatedDate time.Time `gorm:"index:idx_createdDate_robotName,priority:1,sort:desc;column:created_date;type:date;comment:日期" json:"created_date"`
	CreatedAt   int64     `gorm:"column:created_at;autoCreateTime;type:int;size:64;comment:创建时间" json:"created_at"`
}

// TableName get sql table name.获取数据库表名
func (m MaAIServiceFaceCount) TableName() string {
	return "ma_ai_service_face_count"
}

// 模式自动注册
func init() {
	Models = append(Models, &MaAIServiceFaceCount{})
}

// 用于分表的model
type MaAIServiceFaceCountTpl struct {
	MaAIServiceFaceCount
}

func (m MaAIServiceFaceCountTpl) TableName() string {
	return "ma_ai_service_face_count_tpl"
}
